home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / comms / metamail-2.3a / elm113diffs.lha / f1.diff < prev    next >
Text File  |  1992-06-14  |  8KB  |  330 lines

  1. *** Elm113/f1.c    Sat Apr 18 15:43:36 1992
  2. --- new/f1.c    Mon May 04 23:57:08 1992
  3. ***************
  4. *** 1,6 ****
  5. --- 1,12 ----
  6.   #include "prefs.h"
  7. + #ifdef LATTICE
  8.   #include <proto/dos.h>
  9.   #include <proto/exec.h>
  10. + #endif
  11. + #ifdef DICE
  12. + #include <clib/dos_protos.h>
  13. + #include <clib/exec_protos.h>
  14. + #endif
  15.   
  16.   
  17.   Prototype void sendmail(char *, char *);
  18. ***************
  19. *** 94,100 ****
  20.           sprintf(String,"sendmail <%s -f %s -R \"%s\"",MailTmp,"MAILER-DAEMON","Mail Delivery Subsystem");
  21.         else if (SendmailVersion==SM_OTHER)
  22.           sprintf(String,"sendmail <%s -f %s",MailTmp,"MAILER-DAEMON");
  23. !       Execute(String,NULL,NULL);
  24.       }
  25.     }
  26.   
  27. --- 100,106 ----
  28.           sprintf(String,"sendmail <%s -f %s -R \"%s\"",MailTmp,"MAILER-DAEMON","Mail Delivery Subsystem");
  29.         else if (SendmailVersion==SM_OTHER)
  30.           sprintf(String,"sendmail <%s -f %s",MailTmp,"MAILER-DAEMON");
  31. !       Execute(String,(BPTR)NULL,(BPTR)NULL);
  32.       }
  33.     }
  34.   
  35. ***************
  36. *** 123,129 ****
  37.           sprintf(String,"sendmail <%s -f %s -R \"%s\"",MailTmp,"MAILER-DAEMON","Mail Delivery Subsystem");
  38.         else if (SendmailVersion==SM_OTHER)
  39.           sprintf(String,"sendmail <%s -f %s",MailTmp,"MAILER-DAEMON");
  40. !       Execute(String,NULL,NULL);
  41.       }
  42.     }
  43.   }
  44. --- 129,135 ----
  45.           sprintf(String,"sendmail <%s -f %s -R \"%s\"",MailTmp,"MAILER-DAEMON","Mail Delivery Subsystem");
  46.         else if (SendmailVersion==SM_OTHER)
  47.           sprintf(String,"sendmail <%s -f %s",MailTmp,"MAILER-DAEMON");
  48. !       Execute(String,(BPTR)NULL,(BPTR)NULL);
  49.       }
  50.     }
  51.   }
  52. ***************
  53. *** 145,150 ****
  54. --- 151,161 ----
  55.   
  56.       I=*i_th(Number);
  57.   
  58. + #ifndef NOMETAMAIL
  59. +     if (!getenv("NOMETAMAIL") && I.NotPlain) {
  60. +       sprintf(TBuffer,"\fExternal pager: %s, message: %d.\n","metamail",Number);
  61. +     } else
  62. + #endif
  63.       sprintf(TBuffer,"\fExternal pager: %s, message: %d.\n",Pager,Number);
  64.       outline();
  65.   
  66. ***************
  67. *** 159,164 ****
  68. --- 170,199 ----
  69.         return;
  70.       }
  71.   
  72. + #ifndef NOMETAMAIL
  73. +     if (!getenv("NOMETAMAIL") && I.NotPlain) {
  74. +       j=I.ArtikelStart;
  75. +       l=I.ArtikelEnd;
  76. +       fseek(in,j,0);
  77. +       while(getline(in,Text,&r) && (r<=l)) {
  78. +         fprintf(out,"%s\n",Text);
  79. +       }
  80. +       CloseHomeBox(in);
  81. +       fclose(out);
  82. +       sprintf(Text,"metamail <* -m Elm %s",MailTmp);
  83. +       WorkbenchToFront();
  84. +       Execute(Text,(BPTR)NULL,(BPTR)NULL);
  85. +       ElmToFront();
  86. +       HandleReturns(I);
  87. +       i_th(Number)->Status |= READ;
  88. +       return;
  89. +     }
  90. + #endif
  91.       sprintf(Text,"Message %d/%d  From %.50s",Number,MaxArticle,I.FromName?I.FromName:I.From);
  92.       while ((6+strlen(Text))<EXT_PAGER_WIDTH)  /* +6 (ctrl-chars, see above) -6 (length of date) */
  93.         strcat(Text," ");
  94. ***************
  95. *** 197,203 ****
  96.   
  97.       sprintf(Text,"%s %s",Pager,MailTmp);
  98.       WorkbenchToFront();
  99. !     Execute(Text,NULL,NULL);
  100.       ElmToFront();
  101.   
  102.       HandleReturns(I);
  103. --- 232,238 ----
  104.   
  105.       sprintf(Text,"%s %s",Pager,MailTmp);
  106.       WorkbenchToFront();
  107. !     Execute(Text,(BPTR)NULL,(BPTR)NULL);
  108.       ElmToFront();
  109.   
  110.       HandleReturns(I);
  111. ***************
  112. *** 229,236 ****
  113.   
  114.       I=*i_th(Number);
  115.   
  116. ! display_page:
  117.   
  118.       if(!(fp=OpenHomeBox())) {
  119.         status_msg("error: cannot open folder - mail not read",100L);
  120.         return;
  121. --- 264,278 ----
  122.   
  123.       I=*i_th(Number);
  124.   
  125. ! #ifndef NOMETAMAIL
  126. !     if (!getenv("NOMETAMAIL") && I.NotPlain) {
  127. !       readmail_ext(Number,full_header);
  128. !       return;
  129. !     }
  130. ! #endif
  131.   
  132. + display_page:
  133.       if(!(fp=OpenHomeBox())) {
  134.         status_msg("error: cannot open folder - mail not read",100L);
  135.         return;
  136. ***************
  137. *** 600,610 ****
  138.   
  139.   
  140.   
  141. ! void
  142. ! forwardmail(int Number,int full_header)
  143.   {
  144.       FILE *in,*out;
  145.       char String[MAX_LINELENGTH];
  146.       char *subj;
  147.       struct MailItem I;
  148.   
  149. --- 642,781 ----
  150.   
  151.   
  152.   
  153. ! #ifndef NOMETAMAIL
  154. ! /*
  155. !  * The string 'from' is going to be placed inside quotes ('"') as an
  156. !  * argument to the CLI. Quote all characters which can be interpreted by
  157. !  * the CLI. We currently quote '*' and '"', should any other characters be
  158. !  * quoted?
  159. !  */
  160. ! quoteQuotedString(char *from,char *to)
  161.   {
  162. +     while (*from) {
  163. +       if (*from == '*' || *from == '"') {
  164. +         *to++ = '*';
  165. +       }
  166. +       *to++ = *from++;
  167. +     }
  168. +     *to = 0;
  169. + }
  170. + void
  171. + replyMIMEmail(int Number,BOOL group_reply)
  172. + {
  173.       FILE *in,*out;
  174.       char String[MAX_LINELENGTH];
  175. +     struct MailItem I;
  176. +     long r;
  177. +     if (Number<1 || Number>MaxArticle)
  178. +       return;
  179. +     if (!(out=fopen(MailTmp,"w"))) {
  180. +       status_msg("error: cannot open temporary file - mail not sent",100L);
  181. +       return;
  182. +     }
  183. +     I=*i_th(Number);
  184. +     if((in=OpenHomeBox())==NULL) {
  185. +       status_msg("error: cannot open folder - mail not sent",100L);
  186. +       fclose(out);
  187. +       return;
  188. +     }
  189. +     do_introduction(out,ReplyIntro,&I);
  190. +     fseek(in,I.ArtikelStart,0);
  191. +     while(getline(in,String,&r) && (r<=I.ArtikelEnd)) {
  192. +       fprintf(out,"%s\n",String);
  193. +     }
  194. +     CloseHomeBox(in);
  195. +     fclose(out);
  196. +     putst(" ");
  197. +     putst(MailTmp);
  198. +     strcpy(String, "mailto <* \"");
  199. +     if (I.ReplyTo)
  200. +       quoteQuotedString(I.ReplyTo, String + strlen(String));
  201. +     else
  202. +       quoteQuotedString(I.From, String + strlen(String));
  203. +     strcat(String, "\"");
  204. +     if (group_reply) {
  205. +       struct AliasItem *cc_list,*to_list,*l;
  206. +       BOOL firstTime = TRUE;
  207. +       to_list = list_wo_own(I.To);
  208. +       cc_list = list_wo_own(I.Cc);
  209. +       for (l = cc_list; l; l = l->next) {
  210. +         if (l->alias) {
  211. +           if (firstTime) {
  212. +             firstTime = FALSE;
  213. +             strcat(String, " -c \"");
  214. +           }
  215. +           strcat(String, " ");
  216. +           quoteQuotedString(l->alias, String + strlen(String));
  217. +         }
  218. +       }
  219. +       for (l = to_list; l; l = l->next) {
  220. +         if (l->alias) {
  221. +           if (firstTime) {
  222. +             firstTime = FALSE;
  223. +             strcat(String, " -c \"");
  224. +           }
  225. +           strcat(String, " ");
  226. +           quoteQuotedString(l->alias, String + strlen(String));
  227. +         }
  228. +       }
  229. +       if (!firstTime)
  230. +         strcat(String, "\"");
  231. +       FreeAliasList(&cc_list);
  232. +       FreeAliasList(&to_list);
  233. +     }
  234. +     strcat(String, " -s ");
  235. +     if (I.Subject==NULL || strlen(I.Subject)<1) {
  236. +       strcat(String, "\"Re: your mail\"");
  237. +     } else if (strnicmp(I.Subject,"Re:",3)==0) {
  238. +       strcat(String, "\"");
  239. +       quoteQuotedString(I.Subject, String + strlen(String));
  240. +       strcat(String, "\"");
  241. +     } else {
  242. +       strcat(String, "\"Re: ");
  243. +       quoteQuotedString(I.Subject, String + strlen(String));
  244. +       strcat(String, "\"");
  245. +     }
  246. +     if (I.MessageID != NULL && strlen(I.MessageID) > 0) {
  247. +       strcat(String, " -r \"");
  248. +       quoteQuotedString(I.MessageID, String + strlen(String));
  249. +       strcat(String, "\"");
  250. +     }
  251. +     WorkbenchToFront();
  252. +     Execute(String,(BPTR)NULL,(BPTR)NULL);
  253. +     ElmToFront();
  254. +     i_th(Number)->Status |= ANSWERED;
  255. + }
  256. + #endif
  257. + void
  258. + forwardmail(int Number,int full_header)
  259. + {
  260. +     FILE *in,*out;
  261. +     char String[MAX_LINELENGTH];
  262.       char *subj;
  263.       struct MailItem I;
  264.   
  265. ***************
  266. *** 869,875 ****
  267.       fclose(out);
  268.   
  269.       sprintf(exec,PipeDefault,MailTmp);
  270. !     Execute(exec,NULL,NULL);
  271.   /*
  272.       Delay(100L);
  273.       Close(fh);
  274. --- 1040,1046 ----
  275.       fclose(out);
  276.   
  277.       sprintf(exec,PipeDefault,MailTmp);
  278. !     Execute(exec,(BPTR)NULL,(BPTR)NULL);
  279.   /*
  280.       Delay(100L);
  281.       Close(fh);
  282. ***************
  283. *** 902,908 ****
  284.     str=malloc(strlen(MailEditor)+strlen(name)+2);
  285.     sprintf(str,"%s %s",MailEditor,name);
  286.     WorkbenchToFront();
  287. !   Execute(str,NULL,NULL);
  288.     ElmToFront();
  289.     free(str);
  290.   }
  291. --- 1073,1079 ----
  292.     str=malloc(strlen(MailEditor)+strlen(name)+2);
  293.     sprintf(str,"%s %s",MailEditor,name);
  294.     WorkbenchToFront();
  295. !   Execute(str,(BPTR)NULL,(BPTR)NULL);
  296.     ElmToFront();
  297.     free(str);
  298.   }
  299.